package com.conan.encapsulation.exer1;import java.util.EmptyStackException;/** * @version 加油！！！ * @Description * @Author 谷藤新一GYC * @Date 2023/8/7-8:48 */public class PersonTest {    public static void main(String[] args) {        Person p1 = new Person();        p1.setAge(18);        System.out.println(p1.getAge());    }}class Person{    private String name;    private int age;    public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public int getAge() {        return age;    }    public void setAge(int age) {        if(age>0&&age<130){            this.age = age;        }else {            System.out.println("您输入的数据非法！！");        }    }}   